<?php

/**
Update logs
----    immanuel912         Has change this file
Jan 29, 2011 - trungdt - add no_src to force no src show
*/

function smarty_function_link($params,&$smarty) {
	$loc = $smarty->_tpl_vars['__loc'];
	if (!isset($params['module'])) $params['module'] = $loc->mod;
	if (!isset($params['src']) && @call_user_func(array($loc->mod,'hasSources'))) $params['src'] = $loc->src;
	if (!isset($params['int'])) $params['int'] = $loc->int;
    
    // Jan 29, 2011 - trungdt - add no_src - begin
    if (isset($params['no_src']))
    {
        if (isset($params['src']))
        {
            unset($params['src']);
        }
        unset($params['no_src']);
    }
    // Jan 29, 2011 - trungdt - add no_src - end
  $no_convert=0;
  if (isset($params['no_convert']) &&  ($params['no_convert']==1))
	$no_convert=1;
  
  if (isset($params['isIE'])){
   if ($params['isIE'] == 1)
    {
      // xóa bỏ ajax_action trong nếu có isIE và
      $params['ajax_action']="0";
      $params['router']="popup.php"; 
    }
  }
	//echo exponent_core_makeLink($params);
	$link = exponent_core_makeLink($params);
	// 4/10/2010: immanuel192 add parameter no_convert to make newsmodule work with fancybox version 1.3.1
	if ($no_convert == 0)
	{
		$s = "&";
		$r = "&amp;";
		$link = str_replace($s, $r, $link);
		$s = "&amp;amp;";
		$link = str_replace($s, $r, $link);
	}
	echo $link;
}

?>
